﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NF_Tools
{
    public partial class BF_ServerItem : UserControl
    {
        public BF_ServerItem()
        {
            InitializeComponent();
        }

        

        private string _ServerName;
        private string _ServerImgUrl;
        private string _ServerMeg;
        private bool _ServerCheck;
        private string _ServerPiont;



        [Category("Ternence"),DisplayName("下标")]
        public int index { get; set; }


        [Category("Ternence"), DisplayName("服务项名称")]
        public string ServerName
        {
            get 
            {
                _ServerName = lblServerName.Text;
                return _ServerName; 
            }
            set 
            {
                _ServerName = value;
                lblServerName.Text = value;
            }
        }

        [Category("Ternence"), DisplayName("图标地址")]
        public string ServerImgUrl
        {
            get 
            {
                _ServerImgUrl = picimage.Tag.ToString();
                return _ServerImgUrl; 
            }
            set 
            { 
                _ServerImgUrl = value;
                picimage.Tag = value;
                picimage.ImageLocation = value;
            }
        }

        [Category("Ternence"), DisplayName("服务项描述")]
        public string ServerMeg
        {
            get 
            {
                _ServerMeg = txtMeg.Text.Trim();
                return _ServerMeg;
            }
            set 
            { 
                _ServerMeg = value;
                txtMeg.Text = value;
            }
        }

        [Category("Ternence"), DisplayName("服务项选择")]
        public bool ServerCheck
        {
            get 
            {
                _ServerCheck = cbkCheck.Checked;
                return _ServerCheck;
            }
            set 
            { 
                _ServerCheck = value;
                cbkCheck.Checked = value;
            }
        }

        [Category("Ternence"), DisplayName("服务项提示")]
        public string ServerPiont
        {
            get 
            {
                _ServerPiont = txtMeg.Pointout;
                return _ServerPiont; 
            }
            set 
            { 
                _ServerPiont = value;
                txtMeg.Pointout = value;
            }
        }

        public delegate void ItemCheckEventHanld(object sender,EventArgs e);
        public event ItemCheckEventHanld ItemCheckEvent;
        private void cbkCheck_Click(object sender, EventArgs e)
        {
            if (ItemCheckEvent != null)
                ItemCheckEvent(sender, e);
        }
    
    }
}
